import 'package:clean_app/asset/color.dart';
import 'package:clean_app/asset/textstyle.dart';
import 'package:clean_app/components/miw.dart';
import 'package:clean_app/components/os_svg.dart';
import 'package:flutter/material.dart';

class Login extends StatefulWidget {
  const Login({super.key});

  @override
  State<Login> createState() => _LoginState();
}

class _LoginState extends State<Login> {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(height: 70),
        os_svg(
          path: "lib/img/pic.svg",
          size: 160,
        ),
        Container(height: 60),
        Text(
          "保洁图像数据\n采集与管理",
          textAlign: TextAlign.center,
          style: TextStyle(
            fontSize: 20,
            fontWeight: FontWeight.bold,
          ),
        ),
        Container(height: 50),
        Container(
          margin: EdgeInsets.only(left: 25, right: 25),
          child: myInkWell(
            radius: 100,
            tap: () {
              Navigator.of(context).pushNamed("/login_with_pwd");
            },
            color: Color(0xff3f3d54),
            widget: Container(
              padding: EdgeInsets.symmetric(vertical: 17.5),
              child: Center(
                child: Text(
                  "登录",
                  style: XSTextStyle(
                    context: context,
                    color: os_white,
                    fontSize: 16,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
            ),
          ),
        ),
        Container(
          margin: EdgeInsets.only(left: 25, right: 25, top: 15),
          child: myInkWell(
            radius: 100,
            tap: () {
              Navigator.of(context).pushNamed("/register_with_pwd");
            },
            color: Color(0xff3f3d54).withAlpha(35),
            widget: Container(
              padding: EdgeInsets.symmetric(vertical: 17.5),
              child: Center(
                child: Text(
                  "注册",
                  style: XSTextStyle(
                    context: context,
                    color: os_black,
                    fontSize: 16,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
            ),
          ),
        ),
        Container(
          margin: EdgeInsets.only(left: 30, right: 30, top: 30),
          child: DefaultTextStyle(
            style: XSTextStyle(
              context: context,
              color: Color(0xff666666),
              fontSize: 15,
              fontWeight: FontWeight.normal,
            ),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text("遇到问题？"),
                Row(
                  spacing: 3.5,
                  children: [
                    Icon(
                      Icons.article_outlined,
                      size: 18,
                      color: Color(0xff666666),
                    ),
                    Text("政策与协议"),
                  ],
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }
}
